
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class EventSource {
private List<Listener>listenList=new CopyOnWriteArrayList<Listener>();
public void addlistener(Listener listener) {
	listenList.add(listener);
}
public void changeTempeure(double tempeure) {
	 notifyListeners(new Event(tempeure ));
}
 private void notifyListeners(Event event) {
	 for(Listener listener:listenList) {
		 listener.temperaturechange(event);
	 }
 }

}
